<template>
    <view class="member-list-item touch" @click="goDetail">
        <view class="c-name">{{ item.NickName }}({{ item.CardNumber
        }})</view>
        <view class="reference">{{ item.CompanyName }}</view>
        <view class="main">
            <image src="../../static/img/communtiyGroup/icon_addr.png" class="icon-img"></image>
            <view class="info">
                <view>等级：{{ item.V_GradeName }}</view>
                <view>地址：{{ item.ProvinceName }} {{ item.CityName }} {{ item.RegionName }} {{ item.StreetName }}</view>
                <view>电话：{{ item.Tel }}</view>
            </view>
        </view>
    </view>
</template>

<script>
export default {
    props: {
        item: {
            type: Object,
            default: () => { },
        },
    },
    data() {
        return {}
    },
    methods: {
        goDetail() {
            this.easyGoTo("/pages/order/detail?orderId=" + this.item.OrderId)
        },
        getTypeText() {
            let text = ""
            switch (this.item.ValetType) {
                case 1:
                    text = "代"
                    break
                default:
                    text = "订"
                    break
            }
            return text
        },
        getStateName() {
            let text = ""
            switch (this.item.StateName) {
                case "待发货":
                    text = "docred"
                    break
                case "待订单审核":
                    text = "docyellow"
                    break
                case "待确认收款":
                    text = "docyellow"
                    break
                case "已完成":
                    text = "docgreen"
                    break
                default:
                    text = "dot"
                    break
            }
            return text
        },
        getPayStatus() {
            let text = ""
            switch (this.item.PayStatusName) {
                case "部分付款":
                    text = "pay-state1"
                    break
                case "已付款":
                    text = "pay-state2"
                    break
                default:
                    text = ""
                    break
            }
            return text
        },
        getStateText() {
            let text = ""
            switch (this.item.Type) {
                case 4:
                    text = "待订单审核"
                    break
                default:
                    text = "订"
                    break
            }
            return text
        },
    },
}
</script>

<style lang="scss">
.member-list-item {
    display: flex;
    flex-direction: column;
    padding: 20rpx $app-page-padding;
    background: $color-white;
    margin: $app-page-padding $app-page-padding 0;
    border-radius: 12rpx;

    .c-name {
        font-size: 30rpx;
        font-weight: 500;
        padding-bottom: 12rpx;
    }

    .reference {
        font-size: 28rpx;
        margin-bottom: 20rpx;
    }

    .main {
        display: flex;
        align-items: center;

        .icon-img {
            width: 64rpx;
            height: 64rpx;
            background-color: #E2E2EA;
            border-radius: 64rpx;
            margin-right: 12rpx;
        }

        .info {
            font-size: 24rpx;
            color: #999999;
        }
    }
}
</style>
